package org.stwy.price;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.rap.common.annotation.MetaData;
import com.rap.common.entity.BaseEntity;

/**
*版权信息 (c) RAP 保留所有权利.
*@author Rap.Codegen
*@Team RAP Team
*@Date 2015-4-4 12:26:43
*<p></p>
*
*@参与人：Rap.Codegen
*/
 
@MetaData(value = "指导价")
@Entity
@Table(name = "stwy_price")
@DynamicInsert
@DynamicUpdate
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class PriceEntity extends BaseEntity {
	private static final long serialVersionUID = 1L;
	public static final String PRICE_TYPE_GOV = "1";
	public static final String PRICE_TYPE_MARKET = "2";
	
	@MetaData(value = "价格公布时间",comments="")
	@Column(nullable = true)
	private Date publicTime;
	
	@MetaData(value = "区域",comments="",enumType="stwy_region")
	@Column(nullable = true,length = 4)
	private String region;
	
	@MetaData(value = "用途",comments="",enumType="stwy_usefor")
	@Column(nullable = true,length = 4)
	private String usefor;
	//TODO 价格应该为区间
	@MetaData(value = "价格",comments="")
	@Column(nullable = true)
	private Double price;
	
	@MetaData(value = "价格类型",comments="",enumType="stwy_priceType")
	@Column(nullable = true,length = 4)
	private String priceType;
	
	
	/**
	 * 价格公布时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
	public Date getPublicTime(){
		return this.publicTime;
	}
	public void setPublicTime(Date publicTime){
		this.publicTime = publicTime;
	}
	/**
	 * 区域
	 */
	
	
	public String getUsefor() {
		return usefor;
	}
	public String getRegion() {
		return region;
	}
	public void setRegion(String region) {
		this.region = region;
	}
	public void setUsefor(String usefor) {
		this.usefor = usefor;
	}
	/**
	 * 价格
	 */
	public Double getPrice(){
		return this.price;
	}
	public void setPrice(Double price){
		this.price = price;
	}
	/**
	 * 价格类型
	 */
	public String getPriceType(){
		return this.priceType;
	}
	public void setPriceType(String priceType){
		this.priceType = priceType;
	}
	
}
